home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 61 / Quick PC 61.iso / I386 / WMS.CAB / global2.asa < prev    next >
Encoding:
Text File  |  2003-02-21  |  5.0 KB  |  134 lines

  1. <SCRIPT LANGUAGE="VBScript" RUNAT="Server">
  2. '+-------------------------------------------------------------------------
  3. '
  4. '  Microsoft Windows Media
  5. '  Copyright (C) Microsoft Corporation. All rights reserved.
  6. '
  7. '  File:       Global.asp
  8. '
  9. '  Contents:   initializes the session state
  10. '
  11. '--------------------------------------------------------------------------
  12.  
  13.  
  14. '////////////////////////////////////////////////////////////////
  15. Sub Appplication_OnStart
  16.     Application( "strLocalHostName" ) = Empty
  17.     Application( "strLocalHostNameFullyQualified" ) = Empty
  18.     Application( "strHostIPAddress" ) = Request.ServerVariables( "LOCAL_ADDR" )
  19.     Application( "bLocalHostHasWMS" ) = Empty
  20. end sub
  21.  
  22.  
  23. '////////////////////////////////////////////////////////////////
  24. Sub Session_OnStart
  25.     on error resume next
  26.     Set Session("WMSAdmin") = Server.CreateObject("WMSAdminRemote.ASPAdmin")
  27.  
  28.     Session( "BaseHREF" ) = ""
  29.     
  30.     ' init vars used in error handling code (see Error.asp)
  31.     Session( "ErrorNumber" ) = 0
  32.     Session( "ErrorCulprit" ) = ""
  33.     Session( "ErrorDescription" ) = ""
  34.     Session( "PageReloadedToDisplayError" ) = 0
  35.  
  36.     ' work-around a strange bug whereby session state is lost after long periods of inactivity
  37.     session.timeout = 60
  38.     
  39.     ' init var governing state of the showAll checkbox on the server's plugins page
  40.     Session( "ShowAllPluginCategories" ) = FALSE
  41.  
  42.     ' init vars governing state of the checkboxes in Server_Diag.asp
  43.     Session( "CBTroubleshootingLimitHits" ) = TRUE
  44.     Session( "CBTroubleshootingPluginWarnings" ) = TRUE
  45.     Session( "CBTroubleshootingPluginErrors" ) = TRUE
  46.     Session( "CBTroubleshootingServerWarnings" ) = TRUE
  47.     Session( "CBTroubleshootingServerErrors" ) = TRUE
  48.     
  49.     ' init default value for the refresh timer found in the gutter of several pages
  50.     Session( "RefreshRate" ) = 60
  51.  
  52.     Session( "LocalHostWinName" ) = ""
  53.     
  54.     Session( "Initialized" ) = FALSE
  55.     Session( "ServerStoppedRedirect" ) = FALSE
  56.     Session( "ShowServerList" ) = TRUE
  57.     Session( "ConnectionFailure" ) = FALSE
  58.     Session( "DisplayMcastWarning" ) = FALSE
  59.  
  60.     ' use when adding / deleting pubpoints and enabling / disabling plug-ins
  61.     Session( "bUpdateTreeView" ) = FALSE
  62.     
  63.     ' used to track contents of framesets so that F5 works intuitively
  64.     Dim curPageDictionary    
  65.     Set Session( "CurrentPage" ) = Server.CreateObject("Scripting.Dictionary")
  66.     curPageDictionary = Session( "CurrentPage" ) 
  67.     curPageDictionary.CompareMode = 1
  68.     curPageDictionary.Add "default", "server_status.asp"
  69.  
  70.     ' used as a hash table of server names for security (obfuscation of the server name in the URL)
  71.     Dim serverDictionary
  72.     Set Session( "SvrDictionary" ) = Server.CreateObject("Scripting.Dictionary")
  73.     Set serverDictionary = Session( "SvrDictionary" )
  74.     serverDictionary.CompareMode = 1
  75.  
  76.     ' sniff the browser as few times as possible, since it won't change from session to session
  77.     Session( "BrowserType" ) = CInt( 0 ) 'brUnknown -- as defined in WMSConstants.asp
  78.     Session( "BrowserVersion" ) = CStr( "" )
  79.     Session( "UserAgent" ) = CStr( "" )
  80.     Session( "cssName" ) = CStr( "" )
  81.  
  82.     ' cached server connection
  83.     Set Session( "objCachedServer" ) = Empty
  84.     Set Session( "objCachedPP" ) = Empty
  85.     Session( "strCachedServerName" ) = ""
  86.     Session( "strCachedPPID" ) = ""
  87.     Session( "dwCachedServerStatus" ) = -1
  88.             
  89.     ' Set locale
  90.     Session.LCID = "&H0409"
  91.  
  92.     ' use UTF-8 for encoding.  See also the @CODEPAGE statement at the top of locstrings.h
  93.     Session.CodePage = 65001
  94. End Sub
  95.  
  96. '////////////////////////////////////////////////////////////////
  97. Sub Session_OnEnd
  98.     Set Session("WMSAdmin") = Nothing
  99.     Set Session( "CurrentPage" ) = Nothing
  100.     Set Session( "CurrentPage" ) = Nothing
  101.     Set Session( "SvrDictionary" ) = Nothing
  102.     
  103.     Session( "BaseHREF" ) = ""    
  104.     Session( "ErrorNumber" ) = 0
  105.     Session( "ErrorCulprit" ) = ""
  106.     Session( "ErrorDescription" ) = ""
  107.     Session( "PageReloadedToDisplayError" ) = 0
  108.     Session( "ShowAllPluginCategories" ) = FALSE
  109.     Session( "CBTroubleshootingLimitHits" ) = TRUE
  110.     Session( "CBTroubleshootingPluginWarnings" ) = TRUE
  111.     Session( "CBTroubleshootingPluginErrors" ) = TRUE
  112.     Session( "CBTroubleshootingServerWarnings" ) = TRUE
  113.     Session( "CBTroubleshootingServerErrors" ) = TRUE
  114.     Session( "LocalHostWinName" ) = ""
  115.     Session( "Initialized" ) = FALSE
  116.     Session( "ServerStoppedRedirect" ) = FALSE
  117.     Session( "ShowServerList" ) = TRUE
  118.     Session( "ConnectionFailure" ) = FALSE
  119.     Session( "DisplayMcastWarning" ) = FALSE
  120.     Session( "bUpdateTreeView" ) = FALSE
  121.     Session( "BrowserType" ) = 0
  122.     Session( "BrowserVersion" ) = ""
  123.     Session( "UserAgent" ) = ""
  124.     Session( "cssName" ) = ""
  125.     
  126.     Set Session( "objCachedServer" ) = Nothing
  127.     Set Session( "objCachedPP" ) = Nothing
  128.     Session( "strCachedServerName" ) = ""
  129.     Session( "strCachedPPID" ) = ""
  130.     Session( "dwCachedServerStatus" ) = -1
  131. End Sub
  132. </SCRIPT>
  133.  
  134.